using System;

namespace Kaleida.ServiceMonitor.Model.Runtime
{
    public class RequestErrorResult : RequestResult
    {
        private readonly Exception exception;

        public RequestErrorResult(IOperation operation, DateTime sentOn, Exception exception)
            : base(operation, sentOn)
        {
            this.exception = exception;
        }

        public Exception Exception
        {
            get { return exception; }
        }

        public override string ToListItemText()
        {
            return string.Format("{0:dd-MMM-yyyy HH:mm:ss.fff}:  ({1}) ERROR: {2}", SentOn, Operation.Description, exception.Message);
        }

        public override string ToClipboardItemText()
        {
            return string.Format("{0:dd-MMM-yyyy HH:mm:ss.fff}\t{1}\t{2}", SentOn, exception.Message, Operation.Description);
        }
    }
}